<%DIRECTIVE DYNAMIC;%>
<div class="modal-header">
	<button type="button" class="close" data-dismiss="modal" aria-label="Close">
		<span aria-hidden="true">&times;</span>
	</button>
	<h5 class="modal-title">修改</h5>
</div>
<form id="eidtForm" role="form" class="form-horizontal parsley-form" data-parsley-validate action="${base}/platform/account/editDo" method="post">
	<div class="modal-body ">
		<input type="hidden" name="id" value="${obj.account.id!}"> 
		<input type="hidden" name="createAt" value="${obj.account.createAt!}">
		<input type="hidden" name="createBy" value="${obj.account.createBy!}">
		<div class="row mb10">
			<div class="col-lg-12">
				<div class="form-group">
					<label for="company_id" class="col-sm-2 control-label">主体</label>

					<div class="col-sm-8">
						<input type="text" class="form-control" value="${obj.account.company.name!}" readonly="readonly">
						<input type="hidden" name="company_id" value="${obj.account.company_id!}">
					</div>
				</div>
				<div class="form-group">
					<label for="name" class="col-sm-2 control-label">名称</label>

					<div class="col-sm-8">
						<input type="text" id="name" class="form-control" name="name" value="${obj.account.name!}" required="required" placeholder="名称">
					</div>
				</div>
				<div class="form-group">
					<label for="account_type" class="col-sm-2 control-label">类型</label>

					<div class="col-sm-8">
						<%for(accountType in obj.accountTypeList){%> 
							<input type="radio" name="account_type" required="required" value="${accountType.id}"<%
						if(obj.account.account_type==accountType.id){ %> checked="checked"
						<% } %> />${accountType.name} <%}%>
					</div>
				</div>
				<div class="form-group">
					<label for="app_scene" class="col-sm-2 control-label">应用</label>
					<div class="col-sm-8">
						<%for(appScene in obj.appSceneList){%> <input type="radio"
							name="app_scene" required="required"
							value="${appScene.id}"<%
						if(obj.account.app_scene==appScene.id){ %> checked="checked" <% }
						%> />${appScene.name} <%}%>
					</div>
				</div>
				<div class="form-group">
					<label for="config" class="col-sm-2 control-label">配置</label>

					<div class="col-sm-8">
						<input type="text" id="config" class="form-control" name="config"
							value="${obj.account.config}" placeholder="配置">
					</div>
				</div>
				<div class="form-group">
					<label for="memo" class="col-sm-2 control-label">备注</label>

					<div class="col-sm-8">
						<textarea rows="5" cols="5" id="memo" class="form-control"
							name="memo" required="required"
							data-parsley-maxlength="5000" placeholder="备注">${obj.account.memo!}</textarea>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="modal-footer">
		<button class="btn btn-default btn-sm btn-parsley">完成</button>
	</div>
</form>
<a class="exit-offscreen"></a>

<script language="JavaScript">
$(document).ready(function () {
	var dialog=$("#editModal");
	$("#editModalDialog").draggable();
    $('#eidtForm').ajaxForm({
        dataType: 'json',
        beforeSubmit: function (arr, form, options) {
        },
        success: function (data, statusText, xhr, form) {
            if (data.code == 0) {
                Toast.success(data.msg);
                datatable.ajax.reload();
               	dialog.modal("hide");
            } else {
                Toast.error(data.msg);
                datatable.ajax.reload();
             	dialog.modal("hide");
            }
        }
    });
});
</script>
